package com.design.mode.command;

import org.junit.jupiter.api.Test;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-04-12 11:21:37
 */
public class CommandTest {

    @Test
    public void test1() {
        Invoker invoker = new Invoker();
        Receiver receiver = new Receiver();

        invoker.setCommand(0, new OnCommand(receiver), new OffCommand(receiver));

        invoker.onButton(0);
        invoker.unButton();

        invoker.offButton(0);
        invoker.unButton();

    }
}
